<?php

namespace App\Http\Controllers\Api;

use App\Common\Comiter;
use App\Http\Controllers\Controller;
use App\ServerLi\BaiDuServer;
use Illuminate\Http\Request;

class ReviewController extends Controller
{
    //
    public function picture(Request $request)
    {
        try {
            if($request->method()!= 'POST')throw new \Exception('请求方式不正确');
            $image = $request->file('image')->store('image');
            $res = BaiDuServer::TextRevew()->image($image);
            return Comiter::success(200,$res,'鉴黄成功');
        }catch (\Exception $exception){
            return Comiter::fail(1,'',$exception->getMessage());
        }
    }
}
